﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using QualityRpt.Service;

namespace QualityRPT
{
    public partial class RawImportLogs : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                string act = Request.Params["act"];
                if (act != null && act == "del")
                {
                    string rowid = Request.Params["rid"];
                    if (rowid != null && rowid != string.Empty)
                    {
                        SysLogsService.Delete(Convert.ToInt64(rowid));
                    }
                }
                this.repeater_data.DataSource = SysLogsService.GetList("LOG_SOURCE="+(int)SysLogsService.LOGSource.RawDataImport);
                this.repeater_data.DataBind();
            }
        }
        public string GetSplitDes(object des, int idx)
        {
            string rt = string.Empty;
            if (des != DBNull.Value)
            {
                string[] desArray = des.ToString().Split(new char[] { '|'});
                if (desArray.Length > idx)
                {
                    rt = desArray[idx];
                }
            }
            return rt;
        }
    }
}